package com.exposit.zbs.converters;

import com.exposit.zbs.model.GrantArea;
import com.exposit.zbs.service.IGrantApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


/**
 * Created by Andrey on 14.08.2014.
 */

@Component
public class StringToGrantAreaConverter implements Converter<String, GrantArea> {

	@Autowired
	IGrantApplicationService grantApplicationService;

	@Override
	public GrantArea convert(String source) {

		return grantApplicationService.getGrantAreaByLink(source);
	}
}
